package com.trkj.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.SessionAttributes;

import com.trkj.service.RSquitService;
import com.trkj.vo.HistoryTaskVo;

@Controller
@SessionAttributes({"emp", "funcIds"})
public class RSquitController {
	@Autowired
	RSquitService rSquitService;
	
	/**
	 * 调用离职管理界面
	 * @author csj
	 * @return
	 */
	@GetMapping("/QuitManagement")
	public String QuitManagement() {
		return "QuitManagement";
	}
	
	/**
	 * 调用待条件分页的模糊查询
	 * @author csj
	 * @return
	 */
	@RequestMapping("/pageQuit")
	@ResponseBody
	public Map<String, Object> pageQuit(String empName,String deptName,Integer page,Integer rows) {
		return rSquitService.getpageQuit(empName, deptName, page, rows);
	}
	
	
	@RequestMapping("/getFinishedQuitAssignee")
	@ResponseBody
	public List<HistoryTaskVo> getFinishedQuitAssignee(@RequestParam("quitId") String quitId) {
		System.out.println(quitId);
		return rSquitService.getFinishedQuitAssignee(quitId);
	}
	
}
